// ==UserScript==
// @name           Use A File
// @namespace      userscripts.org
// @description    Fixes the annoyance of having to hit refresh whenever you accidentally hit 'Use a URL instead' in tumblr.com/new/photo
// @include        http*://www.tumblr.com/new/photo*
// ==/UserScript==

var ndiv = document.createElement('div');
ndiv.innerHTML = '<a href=\"#\" onclick=\"Element.hide(\'use_a_file\');Element.hide(\'photo_url\');Element.show(\'photo_upload\');return false;\">Use a local file</a>';
ndiv.setAttribute("style", "font:11px 'Lucida Grande', Verdana; color:#666; margin-top:5px;display:none;");
ndiv.setAttribute("id", "use_a_file")
document.getElementById("photo_upload").parentNode.insertBefore(ndiv, document.getElementById("photo_upload").nextSibling.nextSibling.nextSibling);
document.getElementById("use_url_link").setAttribute('onclick',"Element.hide('photo_upload');$('photo_src').value = 'http://'; Element.show('photo_url');Element.show('use_a_file');return false;")
